//
//  WJWebVC.swift
//  新浪微博swift
//
//  Created by WJ-Jason on 2017/7/12.
//  Copyright © 2017年 WJ-Jason. All rights reserved.
//

import UIKit

class WJWebVC: WJBaseVC {
    
    fileprivate lazy var webView : UIWebView = UIWebView(frame: UIScreen.main.bounds)

    // 要加载的URL字符串
    var urlString : String? {
        didSet {
            guard let urlStr = urlString,
                  let url = URL(string: urlStr)
            else {
                return
            }
            
            webView.loadRequest(URLRequest(url: url))
        }
    }
}

extension WJWebVC {
    override func setupTableView() {
        
        navItem.title = "网页"
        
        // 设置webView 
        view.insertSubview(webView, belowSubview: navigationBar)
        
        webView.backgroundColor = UIColor.white
        
        webView.scrollView.contentInset.top = navigationBar.bounds.height
    }
}
